package com.hb.test;

import java.io.IOException;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;

/**
 * Hello world!
 *
 */
public class App 
{
    public static void main( String[] args )
    {
        test();
        System.out.println( "Hello World!" );

    }

    private static void test() {
        System.out.println("test");

        Thread t = new Thread(() -> {

        });
    }



    //lamd
    private static void test3() {
        System.out.println("test");

        Thread t = new Thread(() -> {

        });
    }

    //多个异常
    public static void test2(){


        try {
            testthrows();
        } catch (SQLException | IOException e) {
            e.printStackTrace();
        }
    }

    public static void testthrows() throws IOException, SQLException {
    }

    //map
    public void forEach() {
        Map<String, String> map = new HashMap<>();
        map.putIfAbsent("key1", "value1");
        map.putIfAbsent("key2", "value1");
        map.putIfAbsent("key3", "value1");

        map.forEach((key, value) -> System.out.println(key + ":" + value));
    }


}
